#if !defined(PARSE_GENOMIC_INTERVALS_H)
#define PARSE_GENOMIC_INTERVALS_H

#include <string>
#include <vector>
#include <boost/shared_ptr.hpp>

//______________________________________________________________________________
// 
//  genomic_interval
// 
//______________________________________________________________________________
struct t_genomic_interval
{
    std::string                 contig;
    unsigned                    beg;
	unsigned                    end;
	std::string                 name;
};

template <typename Iterator>
struct genomic_interval_grammar;

typedef boost::shared_ptr<genomic_interval_grammar<std::string::const_iterator> > sp_genomic_interval_grammar;

sp_genomic_interval_grammar create_genomic_interval_grammar(unsigned& curr_line_number, bool named_intervals = false);

bool parse_genomic_interval(sp_genomic_interval_grammar p_genomic_interval_grammar, std::string::const_iterator& str_begin, std::string::const_iterator str_end, t_genomic_interval& res);
inline bool parse_genomic_interval(sp_genomic_interval_grammar p_genomic_interval_grammar, const std::string& str, t_genomic_interval& res)
{
	std::string::const_iterator str_beg = str.begin();
	return parse_genomic_interval(p_genomic_interval_grammar, str_beg, str.end(), res);
}
   
   


//______________________________________________________________________________
// 
//  genomic_interval_by_type
// 
//______________________________________________________________________________
struct t_genomic_interval_by_type
{
    std::string                 interval_type;
	std::string                 contig;
    unsigned                    beg;
	unsigned                    end;
};

template <typename Iterator>
struct genomic_interval_by_type_grammar;

typedef boost::shared_ptr<genomic_interval_by_type_grammar<std::string::const_iterator> > sp_genomic_interval_by_type_grammar;

sp_genomic_interval_by_type_grammar create_genomic_interval_by_type_grammar(unsigned& curr_line_number);
bool parse_genomic_interval_by_type(sp_genomic_interval_by_type_grammar p_genomic_interval_by_type_grammar, const std::string& str, t_genomic_interval_by_type& res);



#endif	// PARSE_GENOMIC_INTERVALS_H
